package org.xue.snowmall.bargain.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.xue.snowmall.bargain.entity.BargainEntity;
import org.xue.snowmall.bargain.service.BargainService;
import org.xue.snowmall.common.utils.PageUtils;
import org.xue.snowmall.common.utils.R;

import java.util.List;
import java.util.Map;

/**
 * @author 小刘的小张
 * @version 1.0
 * @description: TODO
 * @date 2021/9/26 9:48
 */
@Controller
public class WebBargainController {

    @Autowired
    private BargainService bargainService;
    @RequestMapping("/")
    public String bargain(Model model
    ,@RequestParam Map<String, Object> params) {

        PageUtils pageUtils = bargainService.queryPage(params);
        List<BargainEntity> list = pageUtils.getList();
        model.addAttribute("list",pageUtils);
        return "bargain";
    }


}
